package com.dha.caodangcongnghe;

import com.dha.asynctask.SinhVienXemDiemAsyncTask;
import com.dha.asynctask.SinhVienXemDiemTongKetAsyncTask;
import com.dha.status.NetworkStatus;
import com.dha.ultility.QuangCao;
import com.dha.variable.ThongTinTaiKhoan;
import com.dha.variable.XemDiemVariable;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.widget.ListView;
import android.widget.TextView;

public class GiaoVienXemDiemTongKetSinhVien extends ActionBarActivity {

	private TextView tvTenSinhVien, tvMaSinhVien;
	private NetworkStatus networkStatus;
	private ListView lv;
//	private QuangCao quangCao;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_xemdiem_tongket);
		
//		quangCao = new QuangCao(this, GiaoVienXemDiemTongKetSinhVien.this);
		lv = (ListView) findViewById(R.id.lv_DS_Diem_hocKy);
		lv.setSelected(false);
		
		tvTenSinhVien = (TextView) findViewById(R.id.tv_tenSV_Diem);
		tvMaSinhVien = (TextView) findViewById(R.id.tv_MaSV_Diem);
		tvMaSinhVien.setText(ThongTinTaiKhoan.maSinhVien);
		tvTenSinhVien.setText(ThongTinTaiKhoan.hoTenSinhVien);
		networkStatus = new NetworkStatus(getBaseContext());
		if (networkStatus.isConnected()) {
			SinhVienXemDiemTongKetAsyncTask asyncTask = new SinhVienXemDiemTongKetAsyncTask(
					GiaoVienXemDiemTongKetSinhVien.this,
					ThongTinTaiKhoan.maSinhVien);
			asyncTask.execute();
		} else {
			Intent intentLoi = new Intent("SuCoVeKetNoiMang");
			startActivity(intentLoi);
		}
	}

}
